﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AssetManagementSystem.Utils {
    public static class DateUtil {

        public static DateTime ValidDate(string dateString) {
            DateTime returnDate = new DateTime();
            try {
                returnDate = DateTime.Parse(dateString);
            } catch (ArgumentNullException argEx) {
                returnDate = DateTime.MinValue;
            } catch (FormatException formEx) {
                returnDate = DateTime.MinValue;
            }
            return returnDate;
        }
    }
}
